package com.zx.www.volunteersystem.util;

import com.zx.www.volunteersystem.pojo.Users;

public class R {
    private Integer code;
    private String msg;
    private Object data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static R ok(Object data) {
        R r = new R();
        r.setCode(200);
        r.setMsg("操作成功");
        r.setData(data);
        return r;
    }
    public static R ok() {
        R r = new R();
        r.setCode(200);
        r.setMsg("操作成功");
        r.setData(null);
        return r;
    }
    public static R error() {
        R r = new R();
        r.setCode(5000);
        r.setMsg("操作失败");
        r.setData(null);
        return r;
    }
    public static R error( String msg) {
        R r = new R();
        r.setCode(5000);
        r.setMsg(msg);
        r.setData(null);
        return r;
    }
}
